package com.photovoltaic.neo4j.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.photovoltaic.neo4j.entity.Industry;
import com.photovoltaic.neo4j.mapper.IndustryMapper;
import com.photovoltaic.neo4j.service.IndustryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import java.util.List;

@Service
public class IndustryServiceImpl implements IndustryService {

    @Autowired
    private IndustryMapper industryMapper;

    @Override
    public List<Industry> searchIndustries(String keyword) {
        LambdaQueryWrapper<Industry> queryWrapper = new LambdaQueryWrapper<>();
        if (StringUtils.hasText(keyword)) {
            queryWrapper.like(Industry::getName, keyword);
        }
        return industryMapper.selectList(queryWrapper);
    }
} 